package com.wsc.juc_001.c_000;


import java.util.concurrent.TimeUnit;

public class WhatIsThread_01 {
    private static class  T1 extends Thread{
        @Override
        public void run() {
            for (int i = 0; i <10 ; i++) {
                //延时一秒
                try {
                    TimeUnit.MICROSECONDS.sleep(1);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("T1");
            }
        }
    }
    public static void main(String[] args) {
        //new T1().run();   //一条线执行，程序的执行顺序是从上往下执行
        new T1().start(); //同时进行，ti和main同时进行执行，没有先后顺序
        for (int i = 0; i <10 ; i++) {
            try {
                TimeUnit.MICROSECONDS.sleep(1);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("main");
        }
    }
}
